define(['jquery', 'bootstrap', 'select2', 'datetimepicker', 'datetimepickerZhCN'], function($, utils){
  return {
    init: function(data) {
      this.initSelectArea();
      this.initDatetimepicker();
    },

    initSelectArea: function() {
      var that = this;
      $(document).ready(function() {
        $('.brand-select').select2({
          minimumResultsForSearch: Infinity
        });

        $('.package-type').select2({
          minimumResultsForSearch: Infinity
        });

        $('.drive-age').select2({
          minimumResultsForSearch: Infinity
        });

        $('.pay-type').select2({
          minimumResultsForSearch: Infinity
        });

      });
    },

    initDatetimepicker: function() {
      $('.pickup-date').datetimepicker({
        language: "zh-CN",
        format: "yyyy-mm-dd",
        autoclose: true,
        todayBtn: true,
        minView: "month", 
      });
      $('.return-date').datetimepicker({
        language: "zh-CN",
        format: "yyyy-mm-dd",
        autoclose: true,
        todayBtn: true,
        minView: "month", 
      });
      $('.pickup-time').datetimepicker({
        language: "zh-CN",
        format: "hh:ss",
        autoclose: true,
        startView: "hour"
      });
      $('.return-time').datetimepicker({
        language: "zh-CN",
        format: "hh:ss",
        autoclose: true,
        startView: "hour"
      });
    }
  }
})